registerTests([
function Distinct_Test_0()
{
	var myArray = [1, 2, 3, 2, 3];
	var items = myArray.Distinct();
	
	Assert.areEqual(items.length, 3, "There should have been 3 items but there were " + items.length);
	for(var i = 0; i < 3; i++)
		Assert.areEqual(items[i], i + 1, "Item " + i + " should have been " + (i + 1) + " but was " + items[i]);
},
function Distinct_Test_1()
{
	var myArray = [{x:1, y:2}, {x:2, y:6}, {x:3, y:3}, {x:2, y:7}, {x:3,y:42}];
	var items = myArray.Distinct("x => x.x");
	
	Assert.areEqual(items.length, 3, "There should have been 3 items but there were " + items.length);
	Assert.isTrue(items[0].x == 1 && items[0].y == 2, "item[0] should have been {x:1, y:2} but was " + items[0]);
	Assert.isTrue(items[1].x == 2 && items[1].y == 6, "item[0] should have been {x:2, y:6} but was " + items[1]);
	Assert.isTrue(items[2].x == 3 && items[2].y == 3, "item[0] should have been {x:3, y:3} but was " + items[2]);
},
function Distinct_Test_2()
{
	var myArray = [{x:1, y:2}, {x:2, y:6}, {x:3, y:3}, {x:2, y:7}, {x:3,y:42}];
	var items = myArray.Distinct("x => x.x", "(a, b) => a == b");
	
	Assert.areEqual(items.length, 3, "There should have been 3 items but there were " + items.length);
	Assert.isTrue(items[0].x == 1 && items[0].y == 2, "item[0] should have been {x:1, y:2} but was " + items[0]);
	Assert.isTrue(items[1].x == 2 && items[1].y == 6, "item[0] should have been {x:2, y:6} but was " + items[1]);
	Assert.isTrue(items[2].x == 3 && items[2].y == 3, "item[0] should have been {x:3, y:3} but was " + items[2]);
},
function Distinct_Test_3()
{
	var myArray = [1, 2, 3, 2, 3];
	var items = myArray.Distinct(null, "(a, b) => a == b");
	
	Assert.areEqual(items.length, 3, "There should have been 3 items but there were " + items.length);
	for(var i = 0; i < 3; i++)
		Assert.areEqual(items[i], i + 1, "Item " + i + " should have been " + (i + 1) + " but was " + items[i]);
},
]);